//
//  MHGLView.h
//  MiHome
//
//  Created by CoolKernel on 08/05/2017.
//  Copyright © 2017 小米移动软件. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MHGLEnum.h"
#import "MHGLProtocolGroups.h"
#import "ILRenderProtocol.h"

@interface MHGLView : UIView<ILRenderProtocol>

- (instancetype)initWithFrame:(CGRect)frame;

- (void)setEffectTargetReponder:(id <MHGLProgramHandlerProtocol>)target;


/**
 设置placehold

 @param buffer buffer
 @param resume 如果实际不合适，当合适的时候再去触发
 */
- (void)setPlaceholdRenderbuffer:(CVPixelBufferRef)buffer
                          resume:(void (^)())resume;

- (void)renderBuffer:(CVPixelBufferRef)buffer;
- (void)renderBuffer:(CVPixelBufferRef)buffer
            finished:(void (^)())finished;

- (void)willEnterForeground;
- (void)enterForeground;

- (void)enterBackground;
- (void)didEnterBackground;

- (void)flush;
- (void)flush:(MHRGBA)rgb;

//获取处理各种效果的responder
- (id <MHGLProgramHandlerProtocol>)getEffectTarget;

- (UIImage *)snapshotPicture;
- (CIImage *)snapShot;
//当摄像机使用畸变校正的时候进行畸变校正
- (UIImage *)snapshotCorrectPicture;
- (CIImage *)snapShotCorrect;

@end
